// pages/promote/promote.js
const customRequst = require('../../common/customRequst');

Page({

  /**
   * 页面的初始数据
   */
  data: {
    groupeInfo: ''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
  
  },

  onShow:function(){
    let that = this;
    customRequst.postRequest('api/groups/info').then(res => {
      if(res.code == 1){
        that.setData({
          groupeInfo: res.data
        })
      }else{
        wx.showToast({
          title: res.msg,
        })
      }
    })
  },
  
  goWithdrawal:function(){
    let that=this;
    if(that.data.groupeInfo.balancePrice <= 0){
      wx.showToast({
        title: '金额不足',
        icon:'error'
      });
      return;
    }
    let url='/pages/promote/Withdrawal/index';
    wx.navigateTo({
      url: url,
    })
  },
})